<template>
  <view class="orderInfo_item_img_list">
    <image
      v-for="img in images"
      :key="img"
      :src="img"
      mode="aspectFill"
      @click="preview(img)"
    />
  </view>
</template>

<script>
export default {
  name: 'ImageList',
  props: {
    images: {
      type: Array,
      required: true
    },
    previewList: {
      type: Array,
      default: null
    }
  },
  methods: {
    preview(img) {
      uni.previewImage({
        current: img,
        urls: this.previewList || this.images
      });
    }
  }
}
</script>

<style scoped>
.orderInfo_item_img_list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
image {
  width: 100px;
  height: 100px;
}
</style> 